import BScroll from "better-scroll";

/**
 * 
 * @param {*} that 
 * @param {*} wrapper 
 * @param {*} content 
 * @param {*} num 
 * @param {*} itemWidth 
 */
let betterScrollHorizontal = function (that, wrapper, content, num, itemWidth) {
    content.style.width = num * itemWidth + "rem";
    that.$nextTick(() => {
        that.scroll = new BScroll(wrapper, {
            scrollX: true,//横向滚动
            scrollY: false,//关闭纵向滚动
            startX: 0,//横向滚动的开始位置
            click: true //开启浏览器的原生click事件
        });
    });
}
export { betterScrollHorizontal };